package solitaire.presentation;

import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JPanel;

import solitaire.controle.CTasDeCartes;
import solitaire.controle.CTasDeCartesColorees;

public class PTasDeCartesColorees extends JPanel {

	private static final long serialVersionUID = 1612215406319752666L;
	
	private CTasDeCartesColorees controle;
	private int nbCartes;
	
	public PTasDeCartesColorees(CTasDeCartesColorees controle) {
		this.controle = controle;
		setLayout(null);

		setSize(PCarte.largeur, PCarte.hauteur);
		setBorder(null);
		setPreferredSize(getSize());
	}
	
	public void depiler(PCarte carte) {
	}

	public void empiler(PCarte carte) {
		nbCartes++;
		add(carte, 0);
		
		carte.setLocation(0, (nbCartes - 1) * 15);
		
		setVisible(true);
	}

	public void paint(Graphics g) {
		super.paint(g);
		g.setColor(Color.pink);
		g.drawRect(0, 0, getWidth() - 1, getHeight() - 1);
	}
}
